//
//  WDAdStatusManager.m
//  WDPolymerizeSDK
//
//  Created by little People on 2023/6/1.
//

#import "WDAdStatusManager.h"

@implementation WDAdStatusManager
{
    NSString *splashLoadTimeSp;
}

static WDAdStatusManager *_status = nil;
+ (instancetype)shareStatusManager
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _status = [[self alloc] init];
        
    });
    return _status;
}








- (void)adRevenue:(NSString *)type source:(NSString *)source revenue:(NSString *)revenue currency:(NSString *)currency
{
    NSDictionary *json = @{@"type":type,
                           @"source":source,
                           @"revenue":revenue,
                           @"currency":currency
    };
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:REVENUE_EVENT_NAME jsonStr:json];
}

- (void)customAdShowWithEventName:(NSString *)eventName package:(NSString *)package creative:(NSString *)creative
{
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:[NSString stringWithFormat:@"%@_show",eventName] jsonStr:@{@"w_package":package,@"w_creative":creative}];
}

- (void)customAdClickWithEventName:(NSString *)eventName package:(NSString *)package creative:(NSString *)creative
{
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:[NSString stringWithFormat:@"%@_show",eventName] jsonStr:@{@"w_package":package,@"w_creative":creative}];
}

- (void)cardAdClickWithEventName:(NSString *)eventName adType:(NSString *)type
{
    NSString *ad;
    if ([type isEqualToString:@"native"])
    {
        ad = @"5";
    }
    else if ([type isEqualToString:@"自推广"])
    {
        ad = @"6";
    }
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:[NSString stringWithFormat:@"%@_click",eventName] jsonStr:@{@"w_show":ad}];
}

//type:本次实际展示的广告类型 5-native 6-自推广
- (void)cardAdShowWithEventName:(NSString *)eventName adType:(NSString *)type
{
    WDLog(@"card ad开始展示");
    NSString *ad;
    if ([type isEqualToString:@"native"])
    {
        ad = @"5";
    }
    else if ([type isEqualToString:@"自推广"])
    {
        ad = @"6";
    }
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:[NSString stringWithFormat:@"%@_show",eventName]   jsonStr:@{@"w_show":ad}];
}

- (void)inAppPurchaseRequestWithEvent:(NSString *)eventName productId:(NSString *)productId
{
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:[NSString stringWithFormat:@"%@_purchase_request",eventName] jsonStr:@{@"w_product_id":productId}];
}

- (void)inAppPurchaseSuccessWithEvent:(NSString *)eventName productId:(NSString *)productId
{
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:[NSString stringWithFormat:@"%@_purchase_success",eventName] jsonStr:@{@"w_product_id":productId}];
}

- (void)inAppPurchaseFailedWithEvent:(NSString *)eventName productId:(NSString *)productId errorType:(NSString *)type errorMsg:(NSString *)msg
{
    
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:[NSString stringWithFormat:@"%@_purchase_failed",eventName] jsonStr:@{@"w_product_id":productId,@"w_error_type":type,@"w_error_msg":msg}];
}

- (void)inAppPurchaseRevenueWithEvent:(NSString *)eventName type:(NSString *)type source:(NSString *)source revenue:(NSString *)revenue d_revenue:(NSString *)d_revenue currency:(NSString *)currency
{
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:[NSString stringWithFormat:@"%@_Revenue",eventName] jsonStr:@{@"w_type":type,@"w_source":source,@"w_revenue":revenue,@"w_d_revenue":d_revenue,@"w_currency":currency}];
}

- (void)inAppPurchaseRevenueRecordWithEvent:(NSString *)eventName type:(NSString *)type productName:(NSString *)productName orderId:(NSString *)orderId revenue:(NSString *)revenue d_revenue:(NSString *)d_revenue currency:(NSString *)currency isSuccess:(BOOL)isSuccess failureReason:(NSString *)failureReason
{
//    [[WDThinkingManager shareThinkingManager] thinkingTrackEventWithKey:[NSString stringWithFormat:@"%@_Revenue_Record",eventName] jsonStr:@{@"w_type":type,@"w_product_name":productName,@"w_order_id":orderId,@"w_d_revenue":d_revenue,@"w_revenue":revenue,@"w_currency":currency,@"w_is_success":[NSNumber numberWithInt:isSuccess],@"w_failure_reason":failureReason}];
}

@end
